home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / bitmap / fopdemo.frm < prev    next >
Text File  |  1995-05-08  |  3KB  |  89 lines

  1. VERSION 2.00
  2. Begin Form FOpenDemo 
  3.    Caption         =   "Win3 Style File Open Demo"
  4.    ClientHeight    =   2655
  5.    ClientLeft      =   1230
  6.    ClientTop       =   1995
  7.    ClientWidth     =   5685
  8.    Height          =   3345
  9.    Left            =   1170
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   2655
  13.    ScaleWidth      =   5685
  14.    Top             =   1365
  15.    Width           =   5805
  16.    Begin Label Demo4 
  17.       Caption         =   "ThePattern: "
  18.       Height          =   375
  19.       Left            =   480
  20.       TabIndex        =   3
  21.       Top             =   2040
  22.       Width           =   4695
  23.    End
  24.    Begin Label Demo3 
  25.       Caption         =   "TheFileName: "
  26.       Height          =   375
  27.       Left            =   480
  28.       TabIndex        =   2
  29.       Top             =   1440
  30.       Width           =   4575
  31.    End
  32.    Begin Label Demo2 
  33.       Caption         =   "ThePath: "
  34.       Height          =   375
  35.       Left            =   480
  36.       TabIndex        =   1
  37.       Top             =   840
  38.       Width           =   4575
  39.    End
  40.    Begin Label Demo1 
  41.       Caption         =   "FullName: "
  42.       Height          =   375
  43.       Left            =   480
  44.       TabIndex        =   0
  45.       Top             =   240
  46.       Width           =   4575
  47.    End
  48.    Begin Menu File 
  49.       Caption         =   "&File"
  50.       Begin Menu FileOpen 
  51.          Caption         =   "&Open"
  52.       End
  53.       Begin Menu MenuSeparator1 
  54.          Caption         =   "-"
  55.       End
  56.       Begin Menu Done 
  57.          Caption         =   "&Exit"
  58.       End
  59.    End
  60. End
  61.  
  62. Sub Done_Click ()
  63.  ' Bye
  64.     End
  65. End Sub
  66.  
  67. Sub FileOpen_Click ()
  68.  ' Before calling FOPEN.FRM we can specify a new pattern (ThePattern) a new path
  69.  ' (ThePath) and a different Form Title.  Change FullName to an empty string.
  70.     FullName = ""
  71.     ThePattern = "*.*"  ' you can also combine patterns, e.g. ThePattern = "*.BAS;*.FRM;*.TXT"
  72.     FormTitle = "Demo File Open"
  73.  
  74.  ' We want to show the form Modal and Unload it after completion (no reason to
  75.  ' waste resources).
  76.     FOpenForm.Show Modal
  77.     Unload FOpenForm
  78.  
  79.  ' The demo prints out the user's selection.  Note: FullName will be an empty string if
  80.  ' the user cancels.  So check FullName on return from FOPEN to see whether to process
  81.  ' the file.
  82.     If Len(FullName) = 0 Then FullName = "No File Selected"
  83.     demo1.caption = "FullName: " + FullName
  84.     demo2.caption = "ThePath: " + ThePath
  85.     demo3.caption = "TheFileName: " + TheFileName
  86.     demo4.caption = "ThePattern: " + ThePattern
  87. End Sub
  88.  
  89.